home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 19 / madtrb11.zip / MONOSPFX.INC < prev    next >
Text File  |  1985-07-13  |  2KB  |  113 lines

  1. {MONOSPFX.INC}
  2.  
  3. {
  4. This package supports special video effects on the IBM monochrome
  5. display.
  6.  
  7. Source: "More On Monochrome Special Effects", TUG Lines Volume I Issue 6
  8. Author: Don Taylor and R.L. Wulffson, M.D.
  9. Date: 5/11/85
  10. Last revised: 6/15/85  11:40
  11. Application: IBM PC and true compatibles
  12. }
  13.  
  14. VAR
  15.  AttributeSeg : INTEGER;
  16.  AttributeOfs : INTEGER;
  17.  
  18. {--------------------}
  19.  
  20. PROCEDURE InitMonoSPFX;
  21.  
  22. {Find the location of the attribute byte, by changing the video
  23. attribute, then checking for differences}
  24.  
  25. CONST
  26.  MaxOffset = $0900;
  27.  
  28. VAR
  29.  A         : INTEGER;
  30.  Found     : BOOLEAN;
  31.  Attribute : BYTE;
  32.  
  33. {----------}
  34.  
  35. PROCEDURE FindAttribute;
  36.  
  37. BEGIN
  38.  REPEAT
  39.   LowVideo;
  40.   Attribute := MEM[AttributeSeg:AttributeOfs];
  41.   NormVideo;
  42.   IF MEM[AttributeSeg:AttributeOfs] <> Attribute
  43.    THEN Found := True
  44.    ELSE AttributeOfs := SUCC(AttributeOfs)
  45.  UNTIL Found OR (AttributeOfs > MaxOffset)
  46. END; {FindAttribute}
  47.  
  48. {==========}
  49.  
  50. BEGIN {InitMonoSPFX}
  51.  Found        := False;
  52.  AttributeSeg := DSeg;
  53.  AttributeOfs := 0;
  54.  FindAttribute;
  55.  IF NOT Found
  56.   THEN BEGIN
  57.         AttributeSeg := CSeg;
  58.         AttributeOfs := 0;
  59.         FindAttribute
  60.        END
  61. END; {InitMonoSPFX}
  62.  
  63. {---------------------}
  64.  
  65. PROCEDURE Reverse;
  66.  
  67. BEGIN
  68.  MEM[AttributeSeg:AttributeOfs] :=  MEM[AttributeSeg:AttributeOfs] AND $F8;
  69.  MEM[AttributeSeg:AttributeOfs] :=  MEM[AttributeSeg:AttributeOfs] OR  $70
  70. END; {Reverse}
  71.  
  72. {--------------------}
  73.  
  74. PROCEDURE Blink;
  75.  
  76. BEGIN
  77.  MEM[AttributeSeg:AttributeOfs] :=  MEM[AttributeSeg:AttributeOfs] OR  $80
  78. END; {Blink}
  79.  
  80. {--------------------}
  81.  
  82. PROCEDURE UnBlink;
  83.  
  84. BEGIN
  85.  MEM[AttributeSeg:AttributeOfs] :=  MEM[AttributeSeg:AttributeOfs] AND $7F
  86. END; {UnBlink}
  87.  
  88. {--------------------}
  89.  
  90. PROCEDURE UnderLine;
  91.  
  92. BEGIN
  93.  MEM[AttributeSeg:AttributeOfs] :=  MEM[AttributeSeg:AttributeOfs] AND $88;
  94.  MEM[AttributeSeg:AttributeOfs] :=  MEM[AttributeSeg:AttributeOfs] OR  $01
  95. END; {UnderLine}
  96.  
  97. {--------------------}
  98.  
  99. PROCEDURE HiInt;
  100.  
  101. BEGIN
  102.  MEM[AttributeSeg:AttributeOfs] :=  MEM[AttributeSeg:AttributeOfs] OR  $08
  103. END; {HiInt}
  104.  
  105. {--------------------}
  106.  
  107. PROCEDURE LoInt;
  108.  
  109. BEGIN
  110.  MEM[AttributeSeg:AttributeOfs] :=  MEM[AttributeSeg:AttributeOfs] AND $F7
  111. END; {LoInt}
  112.  
  113. {END MONOSPFX.INC}